﻿using Lis.DALFactory;
using Lis.IDAL;
using Lis.IRepository;
using Lis.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lis.Repository
{
    public class BookInfoRepository:GenericRepository<BookInfo>,IBookInfoRepository
    {
        public IEnumerable<BookInfo> GetEntitiesByName(string name)
        {
            return ((IBookInfoDal)CurrentDal).GetEntitiesByName(name).ToList();
        }

        public IEnumerable<BookInfo> GetEntitiesByAuthor(string author)
        {
            return ((IBookInfoDal)CurrentDal).GetEntitiesByAuthor(author).ToList();
        }

        public IEnumerable<BookInfo> GetEntityByISBN(string isbn)
        {
            return ((IBookInfoDal)CurrentDal).GetEntityByISBN(isbn);
        }

        public IEnumerable<BookInfo> GetEntitiesByPublish(string publish)
        {
            return ((IBookInfoDal)CurrentDal).GetEntitiesByPublish(publish).ToList();
        }

        public override void GetDal()
        {
            CurrentDal = AbstractDalFactory.GetBookInfoDal();
        }
    }
}
